package cn.wolfcode.crm.mapper;

import cn.wolfcode.crm.domain.Employee;
import cn.wolfcode.crm.domain.PotentialStudent;
import cn.wolfcode.crm.query.PotentialStudentQueryObject;
import cn.wolfcode.crm.query.QueryObject;
import cn.wolfcode.crm.query.StudentQuery;
import cn.wolfcode.crm.query.StudentShiftQueryObject;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface PotentialStudentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(PotentialStudent record);

    PotentialStudent selectByPrimaryKey(Long id);

    List<PotentialStudent> selectAll();

    int updateByPrimaryKey(PotentialStudent record);

    int queryCount(PotentialStudentQueryObject qo);

    List<PotentialStudent> queryForList(PotentialStudentQueryObject qo);


    List<PotentialStudent> queryIntroducerStudent(String state);


    List<PotentialStudent> queryList(StudentQuery q);

    List<PotentialStudent> query(Long id);

    void updateState(@Param("id") Long id,@Param("state") String state);


    void update(PotentialStudent student);

    //校检tel/qq
    PotentialStudent validateTel(@Param("id") Long id,
                                 @Param("tel") String tel);
    PotentialStudent validateQq(@Param("id") Long id,
                                @Param("qq") String qq);

    void updateClass(@Param("id") Long id,@Param("newClassName")String newClassName,@Param("state")String state);

    //更改最后跟踪时间和跟踪次数
    void updateTracking(@Param("finalTrackingTime") Date finalTrackingTime,
                        @Param("id") Long id);

    void updateById(@Param("id") Long id,@Param("date") Date date);

    int studentCount(StudentQuery q);


    List<PotentialStudent> queryShift(StudentShiftQueryObject qo);
    Integer queryShiftCount(StudentShiftQueryObject qo);

    void updateByShift(PotentialStudent ps);

    void audit(PotentialStudent ps);

    List<PotentialStudent> selectAllByShift();
    //潜在客户池的方法
    List<PotentialStudent> selectByPutPoolState(QueryObject qo);

    void updateByUserName(@Param("userContext") Employee userContext,@Param("id") Long id);
    //放入资源池
    void putPoolState(Long id);
    PotentialStudent getIdByName(String stringCellValue);
}